﻿using DFGK_WMS.Model.DTO;
using DFGK_WMS.Model.Models;
using NPOI.SS.Formula.Functions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DFGK_WMS.IRepository
{
    public interface ITInventoryAdjustsRepository : IBaseRepository<TInventoryAdjust>
    {
        /// <summary>
        /// 库存调整查询
        /// </summary>
        /// <param name="totalCount"></param>
        /// <param name="WhId"></param>
        /// <param name="AreaId"></param>
        /// <param name="Status"></param>
        /// <param name="BillSn"></param>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        List<TInventoryAdjust> GetInventoryAdjusts(out int totalCount, int? WhId, int? AreaId,int? Status,string? BillSn, int pageIndex, int pageSize);


        /// <summary>
        /// 新建库存信息
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        bool AddInventoryAdjusts(TInventoryAdjust item , out string message);

        /// <summary>
        /// 获取单据号
        /// </summary>
        /// <returns></returns>
        string AddDocumentNumber();

        /// <summary>
        /// 根据物料查询信息
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        List<TInventoryAdjustmentDTO> GetWarehouse(int Id);

        /// <summary>
        /// 更新库存信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool UpdateInventoryAdjusts(TInventoryAdjust model);

        /// <summary>
        /// 更新库存信息审核同意
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool UpdateReviewConsent(TInventoryApproveDTO model);

        /// <summary>
        /// 更新库存信息审核驳回
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool UpdateReviewRejection(TInventoryApproveDTO model);

        /// <summary>
        /// 根据当前用户ID查询用户工号
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        List<TUser> GetJobNumberByNowUser(int id);


        /// <summary>
        /// 根据ID获取数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        TInventoryAdjust GetInventoryAdjustsById(int id);

        /// <summary>
        /// 更新审核状态为已调整
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        bool UpdApproved(int id);
    }
}
